<template>
  <div>
    <el-form :inline="true">
      <el-form-item label="搜索条件">
        <el-input v-model="con" placeholder="输入标题"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="pi.list"
      style="width: 100%">
      <el-table-column
        prop="id"
        label="学号6">
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名">
      </el-table-column>
      <el-table-column
        prop="job"
        label="职务">
      </el-table-column>
      <el-table-column
        prop="major"
        label="专业">
      </el-table-column>
      <el-table-column
        prop="grade"
        label="班级">
      </el-table-column>
      <el-table-column
        prop="sex"
        label="性别">
      </el-table-column>
      <el-table-column
        prop="birthday"
        label="生日">
      </el-table-column>
      <el-table-column
        prop="tel"
        label="电话">
      </el-table-column>
      <el-table-column
        label="操作"
      >
        <template slot-scope="scope">
          <router-link :to="{path:'/replayList',query:{id:scope.row.id}}"><el-button>查看</el-button></router-link>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      background
      layout="prev, pager, next"
      :total="pi.total"
      :page-size="pi.pageSize"
      @current-change="handlerChangeNum"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: "hero",
  data(){
    return {
      pi:{},
      con:""
    }
  },
  created(){
    this.doAjax(1,3,"")
  },
  methods:{
    onSubmit(){
      this.doAjax(1,this.pi.pageSize,this.con);
    },
    handlerChangeNum(num){
      this.doAjax(num,this.pi.pageSize,this.con);
    },
    doAjax(pageNo,pageSize,con){
      this.axios.get("/student/selectByCon?pageNo="+pageNo+"&pageSize="+pageSize+"&con="+con).then((resp)=>{
        this.pi=resp.data;
      })
    }
  }
}
</script>

<style scoped>

</style>
